<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    // 数字去重
      var arr1 = [1, 2, 3, 3, 4, 5, 6, 8]
var result = []
for (var i = 0; i < arr1.length; i++) {
  let _hasItem = false
  for (var j = 0; j < result.length; j++) {
    if (arr1[i] === result[j]) {
      _hasItem = true
      break
    }
  }
  if (!_hasItem) {
    result.push(arr1[i])
  }
}
console.log(result)

</script>